#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

typedef struct student 
{
	char name[20];
	int id;
	float score;
}stu;
int main()
{
	stu s = { "qing",231212,80.0 };
	FILE* pf = fopen("example.txt", "w");
	if (pf == NULL)
	{
		perror(" fopen fail");
		return 1;
	}
	fread(&s, sizeof(s), 1, pf);
	printf("%s %d %f", s.name, s.id, s.score);
	fclose(pf);
	pf = NULL;
	return 0;
}